﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Media.Animation;

namespace CECB
{
    /// <summary>
    /// Interaction logic for Login_Window_New.xaml
    /// </summary>
    public partial class Login_Window_New : Window
    {
        public Login_Window_New()
        {
            InitializeComponent();
            (FindResource("showMe") as Storyboard).Begin(this);
            
        }

        private void StackPanel_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                TextBox s = e.Source as TextBox;
                if (s != null)
                {
                    s.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
                }

                e.Handled = true;
            }
        }

        private void buttonLogin_Click(object sender, RoutedEventArgs e)
        {



            if (new cecbClasses.Data_Adapters.Login.UserLogin().UserLoginClick(textbox_Username.Text.Trim(), passwordbox_password.Password))             
            {
                ///new MainUI.Cecb_Main_Menu().Show();
            }
            else
                MessageBox.Show("Enter Valide UserName And Password", "Message", MessageBoxButton.OK , MessageBoxImage.Error);
              
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            new testWindow().Show();
        }

        private void buttonCancel_Click(object sender, RoutedEventArgs e)
        {
           // List<float> xx = new Dss.Methods.FillMatrix().getzz();

          //  foreach (float s in xx)
            //    MessageBox.Show(s+"");
            this.Close();
           // Application.Current.Exit();
        }
    }
}
